#include "MTUnaryOperator.hpp"
#include "Params.h"
#include <sstream>

namespace MathematicaTranslator
{
	std::string* MTUnaryOperator::generateCode(CodeGenContext& context)
	{
		std::ostringstream ss;
		switch (type) {
			case POST:
					ss << *expr.generateCode(context);
					ss << op;
					break;
			case PRE:
					ss << op;
					ss << *expr.generateCode(context);
					break;
		}

		return new std::string(ss.str());
	}
		
	std::string* MTUnaryOperator::getType(){
		// TODO check in map what type is variable
		return expr.getType();
	}
}